﻿// Decompiled with JetBrains decompiler
// Type: Bannerlord.ModuleManager.ModuleIssue
// Assembly: MCMv5, Version=5.10.2.0, Culture=neutral, PublicKeyToken=null
// MVID: 7AB326B9-B2B4-41C2-9177-68E944071101
// Assembly location: D:\steam\steamapps\workshop\content\261550\2859238197\bin\Win64_Shipping_Client\MCMv5.dll

using System.Collections.Generic;
using System.Runtime.CompilerServices;

#nullable enable
namespace Bannerlord.ModuleManager
{
  internal sealed record ModuleIssue
  {
    public ModuleInfoExtended Target { get; set; }

    public string SourceId { get; set; }

    public ModuleIssueType Type { get; set; }

    public string Reason { get; set; }

    public ApplicationVersionRange SourceVersion { get; set; }

    public ModuleIssue()
    {
      this.Target = new ModuleInfoExtended();
      this.SourceId = string.Empty;
      this.Type = ModuleIssueType.NONE;
      this.Reason = string.Empty;
      this.SourceVersion = ApplicationVersionRange.Empty;
    }

    public ModuleIssue(ModuleInfoExtended target, string sourceId, ModuleIssueType type)
    {
      this.Target = target;
      this.SourceId = sourceId;
      this.Type = type;
      this.Reason = string.Empty;
      this.SourceVersion = ApplicationVersionRange.Empty;
    }

    public ModuleIssue(
      ModuleInfoExtended target,
      string sourceId,
      ModuleIssueType type,
      string reason,
      ApplicationVersionRange sourceVersion)
      : this(target, sourceId, type)
    {
      this.Reason = reason;
      this.SourceVersion = sourceVersion;
    }

    [CompilerGenerated]
    public override int GetHashCode()
    {
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      return ((((EqualityComparer<System.Type>.Default.GetHashCode(this.EqualityContract) * -1521134295 + EqualityComparer<ModuleInfoExtended>.Default.GetHashCode(this.\u003CTarget\u003Ek__BackingField)) * -1521134295 + EqualityComparer<string>.Default.GetHashCode(this.\u003CSourceId\u003Ek__BackingField)) * -1521134295 + EqualityComparer<ModuleIssueType>.Default.GetHashCode(this.\u003CType\u003Ek__BackingField)) * -1521134295 + EqualityComparer<string>.Default.GetHashCode(this.\u003CReason\u003Ek__BackingField)) * -1521134295 + EqualityComparer<ApplicationVersionRange>.Default.GetHashCode(this.\u003CSourceVersion\u003Ek__BackingField);
    }

    [CompilerGenerated]
    public bool Equals(ModuleIssue? other)
    {
      if ((object) this == (object) other)
        return true;
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      // ISSUE: reference to a compiler-generated field
      return (object) other != null && this.EqualityContract == other.EqualityContract && EqualityComparer<ModuleInfoExtended>.Default.Equals(this.\u003CTarget\u003Ek__BackingField, other.\u003CTarget\u003Ek__BackingField) && EqualityComparer<string>.Default.Equals(this.\u003CSourceId\u003Ek__BackingField, other.\u003CSourceId\u003Ek__BackingField) && EqualityComparer<ModuleIssueType>.Default.Equals(this.\u003CType\u003Ek__BackingField, other.\u003CType\u003Ek__BackingField) && EqualityComparer<string>.Default.Equals(this.\u003CReason\u003Ek__BackingField, other.\u003CReason\u003Ek__BackingField) && EqualityComparer<ApplicationVersionRange>.Default.Equals(this.\u003CSourceVersion\u003Ek__BackingField, other.\u003CSourceVersion\u003Ek__BackingField);
    }
  }
}
